package org.vectrics.recruiter.job;

import java.io.Serializable;
import java.util.Date;

import org.vectrics.common.db.EventGeneratingEntity;
import org.vectrics.common.db.Expirable;
import org.vectrics.common.db.RecordObject;
import org.vectrics.common.db.Voidable;
import org.vectrics.user.Person;

/**
 * @author mmoore
 */
public class JobStatus implements RecordObject, Voidable, Expirable, 
			Serializable, EventGeneratingEntity {
	public static final long serialVersionUID = 992357093250233L;
	private Long id = null;
	private Date dateStart = null;
	private Date dateEnd = null;
	private Date pendingPostDate = null;
	private Date lastNotifyDate = null;
	private JobStatusType statusType = null;
	private JobStatusReasonType statusReasonType = null;
	private Person person = null;
	private Job job = null;
	private String description = null;
	private boolean voided = false;
	
	
	public JobStatus() {
		super();
	}

	/**
	 * @return Returns the job.
	 */
	public Job getJob() {
		return job;
	}
	/**
	 * @param job The job to set.
	 */
	public void setJob(Job job) {
		this.job = job;
	}
	/**
	 * @return Returns the dateStart.
	 */
	public Date getDateStart() {
		return dateStart;
	}
	/**
	 * @param dateStart The dateStart to set.
	 */
	public void setDateStart(Date dateStart) {
		this.dateStart = dateStart;
	}
	/**
	 * @return Returns the endDate.
	 */
	public Date getDateEnd() {
		return dateEnd;
	}
	/**
	 * @param endDate The endDate to set.
	 */
	public void setDateEnd(Date endDate) {
		this.dateEnd = endDate;
	}
	/**
	 * @return Returns the id.
	 */
	public Long getId() {
		return id;
	}
	/**
	 * @param id The id to set.
	 */
	public void setId(Long id) {
		this.id = id;
	}
	/**
	 * @return Returns the person.
	 */
	public Person getPerson() {
		return person;
	}
	/**
	 * @param person The person to set.
	 */
	public void setPerson(Person person) {
		this.person = person;
	}
	/**
	 * @return Returns the statusType.
	 */
	public JobStatusType getStatusType() {
		return statusType;
	}
	/**
	 * @param statusType The statusType to set.
	 */
	public void setStatusType(JobStatusType statusType) {
		this.statusType = statusType;
	}
	
	
	public int hashCode() {
		if (this.getId() == null)
			return(0);
		return(this.getId().hashCode());
	}
	
	/**
	 * @return Returns the statusReasonType.
	 */
	public JobStatusReasonType getStatusReasonType() {
		return statusReasonType;
	}
	/**
	 * @param statusReasonType The statusReasonType to set.
	 */
	public void setStatusReasonType(JobStatusReasonType statusReasonType) {
		this.statusReasonType = statusReasonType;
	}
	
	
	/**
	 * @return Returns the pendingPostDate.
	 */
	public Date getPendingPostDate() {
		return pendingPostDate;
	}
	/**
	 * @param pendingPostDate The pendingPostDate to set.
	 */
	public void setPendingPostDate(Date pendingPostDate) {
		this.pendingPostDate = pendingPostDate;
	}
	
	
	/**
	 * @return Returns the description.
	 */
	public String getDescription() {
		return description;
	}


	/**
	 * @param description The description to set.
	 */
	public void setDescription(String description) {
		this.description = description;
	}


	/**
	 * @return Returns the lastNotifyDate.
	 */
	public Date getLastNotifyDate() {
		return lastNotifyDate;
	}


	/**
	 * @param lastNotifyDate The lastNotifyDate to set.
	 */
	public void setLastNotifyDate(Date lastNotifyDate) {
		this.lastNotifyDate = lastNotifyDate;
	}


	/**
	 * @return Returns the voided.
	 */
	public boolean getVoided() {
		return voided;
	}
	/**
	 * @param voided The voided to set.
	 */
	public void setVoided(boolean voided) {
		this.voided = voided;
	}
	
	public String toString() {
		return(this.getId() + "|reasonType=" +  this.getStatusReasonType().getCode());
	}
}
